<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">流量池成员管理</a></li>
    </ul>

    <form class="well form-search" method="post" action="{:U('AdminFlow/member')}">
        ICCID：
        <input type="text" name="s_number" style="width: 200px;" value="{$s_number}" placeholder="">

        <input type="submit" class="btn btn-primary" onclick="javascript:ajax_get_list(1);return false;" value="搜索" />
        <!--<a href="{:U('AdminFlow/add_member')}" class="btn btn-primary">新增</a>-->
        <!--<a href="{:U('AdminFlow/batch_member',array('type'=>'add'))}" class="btn btn-primary">批量新增</a>-->
        <a href="{:U('AdminFlow/batch_modify_member')}" class="btn btn-primary">批量修改</a>
        <!--<a href="{:U('AdminFlow/batch_member',array('type'=>'delete'))}" class="btn btn-primary">批量删除</a>-->
    </form>
    <form class="js-ajax-form" action="" method="post">

        <table class="table table-hover table-bordered table-list">
            <thead class="table-head">
                <tr>
                    <td>ICCID</td>
                    <td>成员号码</td>
                    <td>流量限额</td>
                    <td>限额类型</td>
                    <td>归属地</td>
                    <td>生效时间</td>
                    <td>状态</td>
                    <td>修改</td>
                    <!--<td>删除</td>-->
                </tr>
            </thead>
            <!--<foreach name="list" item="vo">-->
                <!--<tr>-->
                    <!--<td>{$vo.card_iccid}</td>-->
                    <!--<td>{$vo.acc_nbr}</td>-->
                    <!--<td>{$vo.flow_quota}</td>-->
                    <!--<td>{$vo.quota_type}</td>-->
                    <!--<td>{$vo.org_id}</td>-->
                    <!--<td>{$vo.eff_date}</td>-->
                    <!--<td>{$vo.state}</td>-->
                    <!--<td><a href="{:U('AdminFlow/modify_member',array('card_number'=>$vo['acc_nbr']))}">修改</a></td>-->
                    <!--&lt;!&ndash;<td>删除</td>&ndash;&gt;-->
                <!--</tr>-->
            <!--</foreach>-->

        </table>
        <div class="loading">
            <img src="__PUBLIC__/images/loading.gif" />
        </div>
        <div class="pagination"></div>
        <div style="float: right">
            <a  href="{:U('Download/current',array('type'=>'flow_member'))}" class="btn btn-primary">下载当前</a>&nbsp;&nbsp;
            <a  href="{:U('Download/all',array('type'=>'flow_member','s_number'=>$s_number))}" class="btn btn-primary" onclick="javascript:return confirm_download();">下载全部</a>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    function refersh_window() {
        var refersh_time = getCookie('refersh_time');
        if (refersh_time == 1) {
            window.location = "{:U('AdminPost/index',$formget)}";
        }
    }


    $(function(){
       $(".loading").hide();
    });

    function ajax_get_list(p){
        $(".tr-data").remove();
        $(".loading").show();
        var s_number = $("input[name='s_number']").val();
        if( p == '' || isNaN(p)){
            p = 1;
        }
        $.ajax({
            url:"{:U('AdminFlow/member')}",
            async:true,
            dataType:"json",
            data:"s_number="+s_number+"&p="+p,
            success:function(t){
                if(t.code == 0){
                    if(t.checkCard != ''){
                        alert(t.checkCard);
                    }
                    var content;
                    var d_length = t.data.length;
                    for(var i=0;i<d_length;i++){
                        var temp = t.data[i];
                        var model_url = '{:U("AdminFlow/modify_member")}&card_number='+temp.acc_nbr;
                        content = content+'<tr class="tr-data">'+
                                '<td>'+temp.card_iccid+'</td>'+
                                '<td>'+temp.acc_nbr+'</td>'+
                                '<td>'+temp.flow_quota+'</td>'+
                                '<td>'+temp.quota_type+'</td>'+
                                '<td>'+temp.org_id+'</td>'+
                                '<td>'+temp.eff_date+'</td>'+
                                '<td>'+temp.state+'</td>'+
                                '<td><a href="'+model_url+'">修改</a></td>'+
                        ' </tr>';
                    }
                    $(".loading").hide();
                    $(".table-list").append(content);
                    $(".pagination").html(t.page);

                }else{
                    alert("数据读取失败")
                }
            }
        });
    }

</script>
</body>
</html>